package controller;

import model.Perspective;

public class ZoomCommand implements Command {

	private Perspective perspective;
	private float currentZoom;
	private float previousZoom;
	
	public ZoomCommand(Perspective perspective, float zoomPercentage){
		this.perspective = perspective;
		this.currentZoom = zoomPercentage;
		this.previousZoom = perspective.getZoom();
	}
	
	@Override
	public void execute() {
		perspective.setZoom(currentZoom);
	}

	@Override
	public void undo() {
		perspective.setZoom(previousZoom);
	}

}
